package lec01.pm;

public class DossPi {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int N = 100000000;
		int M = 0;
		for (int i = 0; i < N; i++) {
			double x = Math.random();
			double y = Math.random();
			if (x * x + y * y <= 1)
				++M;
		}

		double pi = 4.0 * M / N;
		System.out.println(String.format("%.6f", pi));

	}

}
